<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  <title>学生学期学业状况</title>
  <!--link-->
  <link rel="stylesheet" href="../../lib/icon/fontawesome-free-6.4.0/all.css">
  <link rel="stylesheet" href="../../lib/bootstrap-5.1.3-dist/css/bootstrap.css">
  <link rel="stylesheet" href="../../lib/weui/weui.css">
  <link rel="stylesheet" href="../mycss.css">
  <script src="../../lib/jquery/jquery-3.6.1.js"></script>
  <script src="../../lib/axios/axios.js"></script>
  <script src="../../util/httpRequest.js"></script>
  <script src="../../util/myutil.js"></script>
  <script src="../../lib/vue/vue.js"></script>
</head>
<body data-weui-theme="light">
<div id="root" class="container">
  <div v-for="item in spmList">
    <div class="card" style="margin-bottom:1rem">
      <div class="card-header text-center">
        {{item.academicyearname}}{{item.termname}}
      </div>
      
      <table class="table table-bordered table-striped" style="margin-bottom:0">
        <tr>
          <td>课程类别</td>
          <td>必修课</td>
          <td>限选课</td>
          <td>任选课</td>
          <td>毕业设计（论文）</td>
          <td>合计</td>
        </tr>
        <tr>
          <td>应修学分</td>
          <td>{{item.crdtreqedcourdue}}</td>
          <td>{{item.crdtlmtddue}}</td>
          <td>{{item.crdtoptldue}}</td>
          <td>{{item.crdtreqedprctdue}}</td>
          <td>{{item.crdttotaldue}}</td>
        </tr>
        <tr>
          <td>已修学分</td>
          <td>{{parseFloat(item.crdtreqedcour)}}</td>
          <td>{{parseFloat(item.crdtlmtd)}}</td>
          <td>{{parseFloat(item.crdtoptl)}}</td>
          <td>{{parseFloat(item.crdtreqedprct)}}</td>
          <td>{{parseFloat(item.crdtobtn)}}</td>
        </tr>
        <tr>
          <td>平均学分绩点</td>
          <td colspan="2">{{item.crdtgpa}}</td>
          <td>必修课平均学分绩点</td>
          <td colspan="2">{{item.crdtgpareq}}</td>
        </tr>
        <tr>
          <td>平均成绩</td>
          <td colspan="2">{{item.scoreavg}}</td>
          <td>必修课平均成绩</td>
          <td colspan="2">***</td>
        </tr>
      </table>
    </div>
  </div>
</div>
<script>
  const vm = new Vue({
    el:'#root',
    data:{
      spmList:[
        {
          crdtreqedcour:'',
          crdtlmtd:'',
          crdtoptl:'',
          crdtreqedprct:'',
          crdtobtn:'',
          crdtgpa:'',
          crdtgpareq:'',
          crdtreqedcourdue:'',
          crdtlmtddue:'',
          crdtoptldue:'',
          crdtreqedprctdue:'',
          crdttotaldue:'',
          academicyearno:'',
          academicyearname:'',
          termno:'',
          termname:'',
          scoreavg:''
        }
      ]
    },
    methods: {
      verificationObj(key) {
        return verification(key)
      }
    },
    mounted(){
      http({
        url:'/third/spm/stuSpmList',
        method: 'get'
      }).then(response => {
        console.log(response.data)
        if (response.data.code === '200' ){
          this.spmList = response.data.stuSpmList.spmlist
        }
      })
    }
  })
</script>
</body>
</html>